package com.py.custom.tms.application.jvm.bytecode;

import org.openjdk.jol.info.ClassLayout;

public class MyTest2 {

    String str = "welcome";

    private int x = 5;

    public static Integer in = 10;

    public static void main(String[] args) {
        MyTest2 myTest2 = new MyTest2();
        System.out.println(ClassLayout.parseInstance(myTest2).toPrintable());
        myTest2.setX(8);
        myTest2.hashCode();
        in = 20;
        System.out.println("---------------------");
        System.out.println(ClassLayout.parseInstance(myTest2).toPrintable());
    }

    public synchronized void setX(int x) {
        this.x = x;
    }

    public int getX() {
        synchronized (str) {
            System.out.println(str);
        }
        return x;
    }
}
